package com.hk.service;

import java.math.BigDecimal;
import java.util.List;

import org.aspectj.lang.JoinPoint;

import com.hk.commons.HqlFilter;
import com.hk.commons.entity.UserExtraInfo;



public interface IUserExtraInfo {

	public UserExtraInfo findById(long id);
	
	
	/**
	 * 根据id 获得信息
	 * @param userId
	 * @return
	 */
	public UserExtraInfo findByUserId(long userId);

	/**
	 * 保存
	 * 
	 * @param
	 * @return
	 */
	public Long add(UserExtraInfo u);

	/**
	 * 删除
	 * 
	 * @param
	 * @return
	 */
	public void delete(UserExtraInfo u);
	
	
	/**
	 * 根据ID 删除
	 * @param id
	 */
	public void deleteById(Long id);
	/**
	 * 更新
	 * 
	 * @param
	 */
	public void update(UserExtraInfo u);

	public List<UserExtraInfo> findByFilter(HqlFilter hqlFilter, int pageNum,
			int pageSize);

	public List<UserExtraInfo> findByFilter(HqlFilter hqlFilter);

	public Long countByFilter(HqlFilter hqlFilter);
	
	/**
	 * 根据用户Id获取剩余积分
	 * @param userId
	 * @return
	 */
	public Integer getLeftPointsByUserId(Long userId);		
	
	
	/**
	 * 推荐客户总人数加1
	 */
	public Boolean addRelationUserAmount(Long usedId, Long finUserId );
	
	/**
	 * 客户绑卡数 
	 * @param usedId
	 * @return
	 */
	public Boolean addTieCardAmount(Long usedId, Long finUserId );
	
	/**
	 * 客户预约数加1
	 * @param
	 * @return
	 */
	public Boolean addBespeakOrderAmount(Long bespeakOrderId, Long finUserId);
	
	/**
	 *  客户下单数加1
	 */
	public Boolean addPayOrderAmount(Long orderId, BigDecimal amount, Long finUserId);
	
	/**
	 * 增添积分
	 * @param
	 * @param pointRule
	 * @return
	 */
	public Boolean addPoints(Long finUserId, Integer pointRule, String Msg);

	/**
	 * 添加积分
	 * @param finUserId
	 * @param pointRule
	 * @return
	 */
	public Boolean addPoints(Long finUserId, Integer pointRule);
	
	/**
	 * 获取绑卡前几名
	 * @param num
	 * @return
	 */
	public String[] getTopTieCardUser(Integer num);
	
}
